﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
using Utility;
using Model.Dto;

namespace Model
{
    [Serializable]
    [PrimaryKey("Id")]
    [Table("Sys_User")]
    public class Sys_User : BaseData
    {
        /// <summary>
        /// 登陆账号
        /// </summary>
        public string UserName { get; set; }
        public string PassWord { get; set; }
        public UserStatus UserStatus { get; set; }
        public string RealName { get; set; }
        public string EnglishName { get; set; }
        public string Email { get; set; }
        /// <summary>
        /// 1 超级管理员
        /// </summary>
        public int IsSuperAdmin { get; set; }
        public int DeptId { get; set; }
        public GenderEnum Gender { get; set; }
        public string PhoneNumber { get; set; }
        /// <summary>
        /// 角色id，英文逗号分隔多个
        /// </summary>
        public string RoleIds { get; set; }

        #region 扩展属性
        [NotMapped]
        public List<Sys_Role> RoleList { get; set; }
        #endregion
    }

    /// <summary>
    /// 查询参数模型
    /// </summary>
    public class UserQuery : BaseQueryModel
    {
        public string UserName { get; set; }
        public string RealName { get; set; }
        public GenderEnum? Gender { get; set; }
        /// <summary>
        /// 角色id，用于获取某个角色的用户
        /// </summary>
        public int? RoleId { get; set; }
    }
}
